<template>
  <div id="app" :class="sideTheme=== 'theme-dark'?'dark-theme':''">
    <router-view />
  </div>
</template>

<script>
export default  {
  name:  'App',
    data() {
        return {
            title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
            titleTemplate: title => {
                return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
            }
        }
    },
  computed:{
    sideTheme() {
      return this.$store.state.settings.sideTheme
    },
  },
  created() {    
    window.addEventListener('message', (e) => {   
      if(e.data?.type==='view'){  
        this.$store.dispatch('settings/changeSetting', {
          key: 'sideTheme',
          value: e.data?.data?.sideTheme
        })
      }
     
    })
    

  },
  methods: {
  
  },
  beforeDestroy() {
  
  },
}
</script>
